﻿namespace Caliburn.PresentationFramework.RoutedMessaging.Parsers
{
    using System.Windows;
    using RoutedMessaging;
    using Triggers;

    /// <summary>
    /// An implementation of <see cref="ITriggerParser"/> that parses standard events.
    /// </summary>
    public class EventTriggerParser : ITriggerParser
    {
        /// <summary>
        /// Parses the specified trigger text.
        /// </summary>
        /// <param name="target">The targeted ui element.</param>
        /// <param name="triggerText">The trigger text.</param>
        /// <returns></returns>
        public IMessageTrigger Parse(DependencyObject target, string triggerText)
        {
            return new EventMessageTrigger {EventName = triggerText};
        }
    }
}